package org.pskovgu.pskovbus;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Point {
	
	private long id;
	private Bus bus;
	private Station station;
	private Date time;
	private boolean reverse;
	private String weekdays;
	
	public long getId() {
		return id;
	}



	public void setId(long id) {
		this.id = id;
	}



	public Bus getBus() {
		return bus;
	}



	public void setBus(Bus bus) {
		this.bus = bus;
	}



	public Station getStation() {
		return station;
	}



	public void setStation(Station station) {
		this.station = station;
	}



	public Date getTime() {
		return time;
	}



	public void setTime(Date time) {
		this.time = time;
	}



	public boolean isReverse() {
		return reverse;
	}



	public void setReverse(boolean reverse) {
		this.reverse = reverse;
	}



	public String getWeekdays() {
		return weekdays;
	}



	public void setWeekdays(String weekdays) {
		this.weekdays = weekdays;
	}



	
	
	
	
	public String toString()
	{
		SimpleDateFormat df = new SimpleDateFormat("H:mm");
		String timeStr = df.format(time);
		String s = "";
		if ((bus.getStart()==null) || (bus.getStop()==null))
		{
			s = bus.getName();
		}
		else
		{
			if (!reverse)
			{
				s = bus.getStop().toString();
			}
			else
			{
				s = bus.getStart().toString();
			}
		}
		return timeStr +  " " + bus.getNumber() + " " + s;
	}
	
	

}
